Strict

Import agfx

Global myAppScreen:TAppScreen

Class TAgfx_test_app Extends TFramework

	Method OnCreate:Int()
		
		'DEVICE.SetFps(30)		' default FPS is 60
		
		Super.OnCreate()
				

		myAppScreen = New TAppScreen		
		myAppScreen.Prepare()
		
		Self.debug_On = false
		Self.fps_On = True
		
		Return 0
	End Method
	
	
End


Class TAppScreen Extends TScreen
	

	Field Img1:TImage
	Field Img2:TImage
	Field Img3:TImage
	
	' START when app is created
	Method Start:Void()
	
		
		DISPLAY.SetVirtualSize(1024,768)

		IMAGES.Load("ball.png","BALL")
		IMAGES.Load("galaxy2.png","GALAXY",False)
		IMAGES.Load("GAster32.png","STONES",False)
		
		' debug dump list
		IMAGES.Dump()
		
		Self.Img1 = IMAGES.Find("GALAXY")
		Self.Img2 = IMAGES.Find("BALL")
		Self.Img3 = IMAGES.Find("STONES")
		
		
		
	End Method
	
	' main app logic loop update
	Method Update:Void()
		
	End Method
	
	' main app render loop
	Method Render:Void()
		Cls
		Self.Img1.Draw(0,0)
		Self.Img2.Draw(50,50)
		Self.Img3.Draw(100,100)
		Self.Img3.Draw(100,300,45,0.5,0.5)
	End Method
End

